
class EmojiOne {
  String name;
  String shortname;
  String unicode;
  List<String> aliases;
  List<String> aliases_ascii;
  List<String> keywords;
  String category;
  int emoji_order;
  String emojiPath;

  EmojiOne({ required this.name, required this.shortname, required this.unicode, required this.aliases,
    required this.aliases_ascii, required this.keywords, required this.category, required this.emoji_order}) :
        this.emojiPath = 'assets/emojione/png_40/$unicode.png';

  factory EmojiOne.fromJson(Map<String, dynamic> json) =>
      EmojiOne(
        name: json['name'] as String,
        shortname: json['shortname'] as String,
        unicode: json['unicode'] as String,
        aliases: (json['aliases'] as List<dynamic>).map((e) => (e as String)).toList(),
        aliases_ascii: (json['aliases_ascii'] as List<dynamic>).map((e) => (e as String)).toList(),
        keywords: (json['keywords'] as List<dynamic>).map((e) => (e as String)).toList(),
        category: json['category'] as String,
        emoji_order: int.parse(json['emoji_order'] as String)
      );


  initPath() {
    var path = 'assets/emojione/png_40/$unicode.png';
    this.emojiPath = path;
  }

  String getShortName() {
    var shortName = this.shortname;
    var length = shortName.length;
    return shortName.substring(1, length-1);
  }
}

class EmojiOneData {
  EmojiOne emoji;
  String data;

  EmojiOneData({ required this.emoji, required this.data});
}

enum EmojiOneCategory {
  people,
  nature,
  food,
  activity,
  travel,
  objects,
  symbols,
  flags,
}